<script>
/**
 * Copyright (c) 2013-Now http://aidex.vip All rights reserved.
 */
import { getPlatform } from "@/common/util";
let app = {
  onLaunch: function () {
    // 国际化，设置当前语言
    uni.hideTabBar({});
    const _this = this;
    if (this.vuex_locale) {
      this.$i18n.locale = this.vuex_locale;
      this.$u.api.lang({
        lang: this.vuex_locale,
      });
    }
    // 设置底部导航栏角标
    // uni.setTabBarBadge({
    //   index: 0,
    //   text: "3",
    // });
    // uni.removeTabBarBadge({
    //   index: 0
    // });
    this.$u.api.getUserMes().then((res) => {
      if (res.code == 200) {
      }
    });
    this.$u.api.getH5Config().then((res) => {
      if (res.code == 200) {
        this.$u.vuex("vuex_h5Config", res.data);
      }
    });
    this.$u.api.getClientConfig().then((res) => {
      if (res.code == 200) {
        this.$u.vuex("vuex_client", res.data);
      }
    });

    this.$bridge.callHandler(
      "triggerToGetSafeArea",
      JSON.stringify({}),
      (args) => {
        try {
          const data = JSON.parse(args);
          const { bottom, top } = data;
          _this.$u.vuex("vuex_safeArea", {
            top,
            bottom,
          });
        } catch (err) {
          uni.showToast({
            title: "安全距离获取失败",
            icon: "none",
          });
        }
      }
    );
    // px转换到upx的比例
  },
  onShow: function () {},
  onHide: function () {},
  globalData: {
    navHeight: uni.getSystemInfoSync().statusBarHeight,
  },
};
export default app;
</script>
<style>
@import url("~@/static/iconfont/iconfont.css");
</style>
<style lang="scss">
@import "uview-ui/index.scss";
@import "pages/common/aidex.scss";

.ban-scroll {
  height: 100vh;
  overflow: hidden;
  text-align: center;
}

.list-scroll {
}
</style>
